草庐IT

python 解析库Beautiful Soup的安装

全部标签

ruby-on-rails - 安装 ruby​​ gems 后,运行新的 gem 返回 "Could not find"错误

全新的Ubuntu10.04安装:我在让我的gem安装过程正常运行时遇到了一些问题。每当我安装gem时,它都会通过一个漂亮、直接的过程,没有任何问题:$geminstallrailsSuccessfullyinstalledrails-3.2.21geminstalled然后验证版本,也许是一个简单的“rails-v”?不:$rails-v/home/pragone/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in`to_specs':Couldnotfindrailti

ruby - Elasticsearch:SearchPhaseExecutionException/解析失败

我在elasticsearch上运行了以下查询curl-XGET"http://localhost:9200/games_201403031340/_search?pretty=true"-d'{"query":{"field":{"title":"ca"}}}'结果我得到了这个错误"error":"SearchPhaseExecutionException[Failedtoexecutephase[query],allshardsfailed;shardFailures{[znmo0cd5Q3S2_ymuDANqKw][games_201403031340][1]:SearchPar

ruby - 在 Mountain Lion 上安装 Ruby 时出现问题 - ruby​​ 1.9.3 不会编译

我之前看过很多关于此的帖子,并按照他们的说明进行操作,但没有任何效果。我将在下面概述我所做的事情,以及我所遵循的说明-如果您有任何建议,我将不胜感激!我遵循了以下安装说明:http://pragmaticstudio.com/blog/2010/9/23/install-rails-ruby-mac我已经为OSXMountainLion下载了X代码,并安装了gcc编译器:$gcc--versioni686-apple-darwin11-llvm-gcc-4.2(GCC)4.2.1(BasedonAppleInc.build5658)(LLVMbuild2336.11.00)Copyri

ruby-on-rails - 如何解析 url 以获取基本 url? -- rails 3.1

我怎样才能像这样解析urlhttp://www.1800contacts.com/productlist.aspx?dl=P&source=cj&ac=8.2.0007只得到http://www.1800contacts.com?附言。有些url有子域等,所以我不能在这里使用正则表达式。 最佳答案 尝试使用“uri”库:require'uri'address='http://www.1800contacts.com/productlist.aspx?dl=P&source=cj&ac=8.2.0007'uri=URI.parse(a

ruby-on-rails - 为 Ruby on Rails 3.1.0 安装 mysql2 gem

我收到这个错误Gemfileswillremaininstalledin/home/mark/.bundler/tmp/28288/gems/mysql2-0.2.17forinspection.Resultsloggedto/home/mark/.bundler/tmp/28288/gems/mysql2-0.2.17/ext/mysql2/gem_make.outAnerroroccuredwhileinstallingmysql2(0.2.17),andBundlercannotcontinue.Makesurethatgeminstallmysql2-v'0.2.17'succ

ruby - Errno::EACCES:通过 gitlab 安装 gems 时权限被拒绝

我正在尝试设置gitlab并因此使用sudo从另一个用户帐户安装一些gem,但我经常收到Permissiondenied错误。sudo-ugitlab-Hbundleinstall--deployment--withoutdevelopmenttestpostgres>Using...(alotofsuccessfulgemsthere)>Usingpygments.rb(0.3.2)fromhttps://github.com/gitlabhq/pygments.rb.git(atmaster)>Errno::EACCES:Permissiondenied-pygments.rb-0

ruby-on-rails - 安装 New Relic 而不向 repo 添加许可证 key

我想在我的一个开源Rails应用程序(v3.2.12)上安装NewRelic。我不想在repo协议(protocol)中拥有许可证key。我想用ENV之类的东西加载它。默认加载到newrelic.yml文件中。YAML文件在哪里加载?我想我可以手动将它与从ENV哈希加载许可证的哈希合并。关于如何做到这一点的任何提示? 最佳答案 我使用Figarogem使用ENV环境变量处理key,类似于您。对于NewRelic,我有:config/application.yml(.gitignored且未推送到源代码管理)#...NEW_RELIC

ruby - 如何使 gem install 命令仅在未安装或需要更新时安装

我已经阅读了ruby​​gems站点的文档,但我猜想“geminstall”命令总是重新安装、重新编译所有内容,即使已经安装了相同的版本也是如此。如何让geminstall命令只在需要的时候安装? 最佳答案 看起来--conservative标志将使gem命令执行您想要的操作。geminstallrake--conservative来自文档geminstall--help:--conservativeDon'tattempttoupgradegemsalreadymeetingversionrequirement

ruby - 无法安装 JSON gem

我需要安装json,因为我收到此错误:无法在任何来源中找到json-1.4.6我运行了geminstalljson和bundleinstall但我只能在需要json-1.4.6时安装json-1.5.1我的gemfile中有gem'json','1.4.6',所以我不确定发生了什么...更新我收到这个错误:正在安装json(1.4.6)/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1216:in`chmod':不允许操作-/Library/Ruby/Gems/1.

ruby - 有什么办法可以延迟资源的属性解析到 "execute"阶段?

我有两个LWRP。第一个涉及创建磁盘卷、对其进行格式化并将其安装到虚拟机上,我们将此资源称为cloud_volume。第二个资源(它的作用并不重要)需要新格式化卷的UUID,这是必需的属性,我们将此资源称为foobar。资源cloud_volume和foobar被用在类似下面的配方中。volumes.eachdo|mount_point,volume|cloud_volume"#{mount_point}"dosizevolume['size']labelvolume['label']action[:create,:initialize]endfoobar"#{mount_point}